#include <iostream>
#include <map>
#include <string>

// 定义小类型
enum class ElementType {
    IntegrationPoint,
    Particle,
    // 添加其他小类型
};

// 创建一个映射，将小类型映射到对应的数量
using ElementMap = std::map<ElementType, int>;

int main() {
    // 创建附属微元的映射
    std::map<std::string, ElementMap> attachedElements;

    std::map<ElementType, int> test;
    test[ElementType::IntegrationPoint] = 10;
    test[ElementType::Particle] = 20;
    std::cout << "test[IntegrationPoint] = " << test[ElementType::IntegrationPoint] << std::endl;
    std::cout << "test[Particle] = " << test[ElementType::Particle] << std::endl;
    

    // 添加附属微元及其小类型数量
    attachedElements["Element1"] = {{ElementType::IntegrationPoint, 10}, {ElementType::Particle, 20}};
    attachedElements["Element2"] = {{ElementType::IntegrationPoint, 5}, {ElementType::Particle, 15}};

    // 遍历输出附属微元的信息
    for (const auto& element : attachedElements) {
        std::cout << "Attached Element: " << element.first << std::endl;
        for (const auto& subElement : element.second) {
            std::cout << "Type: " << static_cast<int>(subElement.first) << ", Count: " << subElement.second << std::endl;
        }
    }

    return 0;
}